home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d6
/
glazer.arc
/
PERDEPOS.BAS
< prev
next >
Wrap
BASIC Source File
|
1988-10-07
|
1KB
|
29 lines
100 'Periodic Deposit ("PERDEPOSIT")
110 CLS
120 COLOR 0,15 : PRINT "Periodic Deposit" : COLOR 15,0
130 DEFDBL A-Z
140 DEFINT M-N
150 MONEYFMT$ = "$$##,###,###.##"
160 ' Let user enter data
170 PRINT: PRINT "Do not enter dollar signs or commas"
180 PRINT
190 INPUT "Savings goal: ", FV
200 INPUT "Annual interest rate (in percent): ", AR
210 INPUT "Number of years: ", NYEARS
220 INPUT "Number of deposits per year: ", NPY
230 INPUT "Annual inflation rate (in percent): ", INFLATION
240 INPUT "Marginal tax rate (in percent): ",TAXRATE
250 ' Determine after-tax, periodic interest rate
260 PR = (1 + AR / 100) ^ (1 / NPY) - 1
270 PR = PR * (1 - TAXRATE / 100)
280 ' Find periodic deposit
290 IF PR <> 0 THEN DEPOSIT = FV / ( (1+PR) * ( (1+PR) ^ (NPY*NYEARS) -1) / PR) ELSE DEPOSIT=FV/(NPY*NYEARS)
300 ADJUSTEDEPOSIT = DEPOSIT * (1 + INFLATION / 100) ^ NYEARS
310 ' Print results
320 PRINT
330 PRINT "Periodic deposit to reach nominal goal:"; TAB(51);
340 PRINT USING MONEYFMT$; DEPOSIT
350 PRINT "Periodic deposit to reach inflation-adjusted goal:"; TAB(51);
360 PRINT USING MONEYFMT$; ADJUSTEDEPOSIT
370 END